From 80e75cf555ec5225713db4ed0e6ba9fccc4cf9d8 Mon Sep 17 00:00:00 2001 From: "cl349@arcadians.cl.cam.ac.uk" Date: Sat, 20 Nov 2004 00:32:32 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.440 (419e90a0wC3wpCnc_7gY99KZqDBSPA) sync w/ head. --- xen/arch/x86/traps.c | 2 +- xen/common/physdev.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 8fd3295e49..c34d2f7a26 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -391,7 +391,7 @@ asmlinkage int do_page_fault(struct xen_regs *regs, long error_code) ((error_code & 3) == 3) && /* write-protection fault */ ptwr_do_page_fault(addr) ) { - if ( unlikely(d->mm.shadow_mode) ) + if ( unlikely(ed->mm.shadow_mode) ) (void)shadow_fault(addr, error_code); return EXCRET_fault_fixed; } diff --git a/xen/common/physdev.c b/xen/common/physdev.c index 036dcbfe02..95d5063954 100644 --- a/xen/common/physdev.c +++ b/xen/common/physdev.c @@ -125,6 +125,7 @@ int physdev_pci_access_modify( domid_t dom, int bus, int dev, int func, int enable) { struct domain *p; + struct exec_domain *ed; struct pci_dev *pdev; int i, j, rc = 0; @@ -145,6 +146,8 @@ int physdev_pci_access_modify( if ( (p = find_domain_by_id(dom)) == NULL ) return -ESRCH; + ed = p->exec_domain[0]; /* XXX */ + /* Make the domain privileged. */ set_bit(DF_PHYSDEV, &p->d_flags); /* FIXME: MAW for now make the domain REALLY privileged so that it @@ -169,16 +172,16 @@ int physdev_pci_access_modify( /* Now, setup access to the IO ports and memory regions for the device. */ - if ( p->thread.io_bitmap == NULL ) + if ( ed->thread.io_bitmap == NULL ) { - if ( (p->thread.io_bitmap = xmalloc(IOBMP_BYTES)) == NULL ) + if ( (ed->thread.io_bitmap = xmalloc(IOBMP_BYTES)) == NULL ) { rc = -ENOMEM; goto out; } - memset(p->thread.io_bitmap, 0xFF, IOBMP_BYTES); + memset(ed->thread.io_bitmap, 0xFF, IOBMP_BYTES); - p->thread.io_bitmap_sel = ~0ULL; + ed->thread.io_bitmap_sel = ~0ULL; } for ( i = 0; i < DEVICE_COUNT_RESOURCE; i++ ) @@ -195,8 +198,8 @@ int physdev_pci_access_modify( "for device %s\n", dom, r->start, r->end, pdev->slot_name); for ( j = r->start; j < r->end + 1; j++ ) { - clear_bit(j, p->thread.io_bitmap); - clear_bit(j / IOBMP_BITS_PER_SELBIT, &p->thread.io_bitmap_sel); + clear_bit(j, ed->thread.io_bitmap); + clear_bit(j / IOBMP_BITS_PER_SELBIT, &ed->thread.io_bitmap_sel); } } -- 2.30.2